//
//  ViewController.m
//  lagou
//
//  Created by mafeng on 16/7/14.
//  Copyright © 2016年 mafeng. All rights reserved.
//

#import "ViewController.h"
#import "registerViewController.h"
#import "ForgotPWDViewController.h"
#import "BottleView.h"
#import "FXBlurView.h"
#import <QuartzCore/QuartzCore.h>
@interface ViewController ()
@property (nonatomic, strong) UIImageView *backgroundImageView;
@property (nonatomic, strong) UIImageView *lagouImageView;
@property (nonatomic, strong) UIImageView *userImageView;
@property (nonatomic, strong) UIImageView *passWordImageView;
@property (nonatomic, strong) UITextField *userTextField;
@property (nonatomic, strong) UITextField *passWordTextField;
@end

@implementation ViewController
- (void)viewWillAppear:(BOOL)animated {
    self.navigationController.navigationBar.hidden = YES;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
       UIColor *color = [UIColor colorWithRed:0 / 255.0 green:180 / 255.0 blue:140 / 255.0 alpha:1.0];
#pragma mark -- 设置背景图
    self.backgroundImageView = [[UIImageView alloc] initWithFrame:self.view.frame];
    [self.backgroundImageView setImage:[UIImage imageNamed:@"welcome_2"]];
    [self.view addSubview:self.backgroundImageView];
#pragma mark -- 毛玻璃
    FXBlurView *fxView = [[FXBlurView alloc] initWithFrame:self.view.frame];
    fxView.dynamic = NO;
    fxView.blurRadius = 30;
    fxView.tintColor = [UIColor clearColor];
    [self.view addSubview:fxView];
    
#pragma mark -- 中间的logo
    self.lagouImageView = [[UIImageView alloc] initWithFrame:CGRectMake(150, 100, 130, 200)];
    [self.lagouImageView setImage:[UIImage imageNamed:@"logo_lagou"]];
    [self.view addSubview:self.lagouImageView];
    BottleView *bottlView = [[BottleView alloc] init];
    [self.view addSubview:bottlView];
#pragma  mark -- 用户名输入框
    self.userImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
    _userImageView.backgroundColor = [UIColor blackColor];
    self.userImageView.contentMode = UIViewContentModeScaleAspectFit;
    [self.userImageView setImage:[UIImage imageNamed:@"icon_username"]];
    [bottlView addSubview:self.userImageView];
   
    self.passWordImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 52, 50, 50)];
    self.passWordImageView.backgroundColor = [UIColor blackColor];
    [self.passWordImageView setImage:[UIImage imageNamed:@"icon_password"]];
    [bottlView addSubview:self.passWordImageView];
    
    self.userTextField = [[UITextField alloc] initWithFrame:CGRectMake(50, 0, 330, 50)];
    self.userTextField.alpha = 0.3;
    self.userTextField.backgroundColor = [UIColor blackColor];
    [bottlView addSubview:self.userTextField];
    
    UITextField *passWordTextField = [[UITextField alloc] initWithFrame:CGRectMake(50, 52, 330, 50)];
    passWordTextField.alpha = 0.3;
    passWordTextField.backgroundColor = [UIColor blackColor];
    [bottlView addSubview:passWordTextField];
    
#pragma mark -- 登录的button
    UIButton *loginButton = [[UIButton alloc] initWithFrame:CGRectMake(18, 550, 380, 50)];
    loginButton.backgroundColor = color;
    loginButton.layer.cornerRadius = 5;
    [loginButton maskView];
    [loginButton setTitle:@"登  录" forState:UIControlStateNormal];
    [loginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.view addSubview:loginButton];
    
#pragma mark -- 忘记密码
    UIButton *forgetButton = [UIButton buttonWithType:UIButtonTypeSystem];
    forgetButton.frame = CGRectMake(18, 610, 60, 30);
    [forgetButton setTitle:@"忘记密码" forState:UIControlStateNormal];
    [forgetButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [forgetButton addTarget:self action:@selector(forgotButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:forgetButton];
    
    
#pragma mark -- 现在就注册
    UIButton *goRegisterButton = [UIButton buttonWithType:UIButtonTypeSystem];
    goRegisterButton.frame = CGRectMake(170, 630, 100, 30);
    [goRegisterButton setTitle:@"现在注册拉勾" forState:UIControlStateNormal];
    [goRegisterButton setTitleColor:color forState:UIControlStateNormal];
    [goRegisterButton addTarget:self action:@selector(goRegister:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:goRegisterButton];
    
#pragma mark -- 两条白线
    UIView *leftWhiteLine = [[UIView alloc] initWithFrame:CGRectMake(18, 675, 170, 2)];
    leftWhiteLine.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:leftWhiteLine];
    
    UIView *rightWhiteLine = [[UIView alloc] initWithFrame:CGRectMake(228, 675, 160, 2)];
    rightWhiteLine.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:rightWhiteLine];
#pragma mark -- or Label
    UILabel *orLabel = [[UILabel alloc] initWithFrame:CGRectMake(200, 660, 30, 30)];
    [orLabel setTextColor:[UIColor whiteColor]];
    [orLabel setText:@"or"];
    [self.view addSubview:orLabel];
    
#pragma mark -- 随便逛逛
    UIButton *goLookButton = [UIButton buttonWithType:UIButtonTypeSystem];
    goLookButton.frame = CGRectMake(165, 690, 100, 30);
    [goLookButton setTitle:@"随便逛逛>>" forState:UIControlStateNormal];
    [goLookButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.view addSubview:goLookButton];
 
}
- (void)goRegister:(UIButton *)button {
    registerViewController *registerVC = [[registerViewController alloc] init];
    self.modalTransitionStyle = UIModalTransitionStylePartialCurl;
    [self presentViewController:registerVC animated:YES completion:^{
        
        
    }];
}
- (void)forgotButtonAction:(UIButton *)button {
    ForgotPWDViewController *forgotPWDVC = [[ForgotPWDViewController alloc] init];
    [self.navigationController pushViewController:forgotPWDVC animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
